﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.Collections.Generic;

namespace System.Windows.Media.DirectShow.Avi
{
    public class AviFileWriter
    {

        private BinaryWriter writer;

        public AviFileWriter(BinaryWriter writer)
        {
            this.writer = writer;
        }

        public void Write(AviFile file)
        {
            writer.Write((int)(FourCC)"RIFF");
            writer.Write(0); // File length
            writer.Write((int)(FourCC)"AVI");

            WriteLists(file.Lists);
        }

        private void WriteLists(IList<AviList> list)
        {
            foreach (AviList l in list)
            {
                writer.Write((int)(FourCC)"LIST");
                writer.Write(0); // list length

            }
        }
    }
}
